package cn.wolfcode.ssm.enums;

import lombok.Getter;

@Getter
public enum NoticeStatusEnum {
    COMMON("普通",0),
    IMPORTANT("重要",1),
    URGENT("紧急",2);
    private String name;
    private Integer value;

    NoticeStatusEnum(String name, Integer value) {
        this.name  = name;
        this.value = value;
    }

    public static String findEnumNameByValue(Integer value){
        NoticeStatusEnum[] values = NoticeStatusEnum.values();
        for (NoticeStatusEnum anEnum : values) {
            if (anEnum.value==value) {
                return anEnum.name;
            }
        }
        return null;
    }
}
